<template>
  <div class="UserList">
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="用户会员名">
        <el-input v-model="formInline.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="用户手机号">
        <el-input v-model="formInline.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="账户等级">
        <el-select v-model="formInline.region" placeholder="请选择">
          <el-option label="全部" value="shanghai"></el-option>
          <el-option label="优粉团" value="beijing"></el-option>
          <el-option label="优钻石粉" value="beijing"></el-option>
          <el-option label="优金粉" value="beijing"></el-option>
          <el-option label="优银粉" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="账号状态">
        <el-select v-model="formInline.region" placeholder="请选择">
          <el-option label="全部" value="shanghai"></el-option>
          <el-option label="待审核" value="beijing"></el-option>
          <el-option label="已审核" value="beijing"></el-option>
          <el-option label="已停用" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">搜索</el-button>
        <el-button type="primary" @click="onSubmit">重置</el-button>
        <el-button type="primary" @click="onSubmit">创建账号</el-button>
        <el-button type="primary" @click="onSubmit">批量通过审批</el-button>
      </el-form-item>
    </el-form>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="团长用户名">
        <el-input v-model="formInline.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="团长手机号">
        <el-input v-model="formInline.user" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="粉丝等级">
        <el-select v-model="formInline.region" placeholder="请选择">
          <el-option label="全部" value="shanghai"></el-option>
          <el-option label="优粉团" value="beijing"></el-option>
          <el-option label="优钻石粉" value="beijing"></el-option>
          <el-option label="优金粉" value="beijing"></el-option>
          <el-option label="优银粉" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="粉丝关系">
        <el-select v-model="formInline.region" placeholder="请选择">
          <el-option label="全部" value="shanghai"></el-option>
          <el-option label="一级粉丝" value="beijing"></el-option>
          <el-option label="二级粉丝" value="beijing"></el-option>
          <el-option label="三级已外粉丝" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="粉丝账号状态">
        <el-select v-model="formInline.region" placeholder="请选择">
          <el-option label="全部" value="shanghai"></el-option>
          <el-option label="待审核" value="beijing"></el-option>
          <el-option label="已审核" value="beijing"></el-option>
          <el-option label="已停用" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">搜索该账号粉丝</el-button>
        <el-button type="primary" @click="onSubmit">重置</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column prop="name" label="用户名">
        <template slot-scope="scope">
          <span @click="goDetail()" type="text" size="small">{{scope.row.name}}</span>
        </template>
      </el-table-column>
      <el-table-column prop="date" label="等级"></el-table-column>
      <el-table-column prop="address" label="手机号"></el-table-column>
      <el-table-column prop="address" label="一级/二级粉丝数" width="130"></el-table-column>
      <el-table-column prop="address" label="累计收益"></el-table-column>
      <el-table-column prop="address" label="团队订单数"></el-table-column>
      <el-table-column prop="address" label="团队订单金额"></el-table-column>
      <el-table-column prop="address" label="注册时间"></el-table-column>
      <el-table-column prop="address" label="账号状态"></el-table-column>
      <el-table-column prop="address" label="操作">
        <template slot-scope="scope">
          <el-button type="primary" @click="onSubmit">通过审核</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[100, 200, 300, 400]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="400"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  name: "UserList",
  components: {},
  data() {
    return {
      formInline: {
        user: "",
        region: ""
      },
      currentPage: 4,
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄"
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄"
        }
      ]
    };
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    onSubmit() {
      console.log("submit!");
    },
    goDetail() {
      this.$router.push("detail");
    }
  }
};
</script>

<style scoped>
.UserList {
}
</style>

